package nl.hu.vakantievibes.server;

import java.util.ArrayList;
import java.util.Date;

import nl.hu.vakantievibes.domain.Reis;

public class AlleReizen
{
	private ArrayList <Reis> reizen = new ArrayList <Reis>();
	private static AlleReizen ar;
	
	public static AlleReizen get() {
		if(ar == null) {
			ar = new AlleReizen();
		} 
		return ar;
	}
	
	public boolean addReis(String nm, String ld, String ps, double prs, Date vdtm, Date adtm, String oms) {
		Reis r = new Reis(nm, ld, ps, prs, vdtm, adtm, oms);
		return reizen.add(r);
	}
	
	public ArrayList<Reis> getReizen(){
		return reizen;
	}
	
	public Reis getReis(String reisnaam){
		Reis tempR = null;
		for(Reis r : reizen){
			if(reisnaam.equals(r.getNaam())){
				tempR = r;
			}
		}
		return tempR;
	}
}